Skip to content

fix(security): 2 improvements across 2 files#4135

Open
tomaioo wants to merge 2 commits into
LiteFarmOrg:integrationfrom
tomaioo:fix/security/predictable-uuid-version-used-for-user-i
Open

fix(security): 2 improvements across 2 files#4135
tomaioo wants to merge 2 commits into
LiteFarmOrg:integrationfrom
tomaioo:fix/security/predictable-uuid-version-used-for-user-i

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 22, 2026

Summary

fix(security): 2 improvements across 2 files

Problem

Severity: Medium | File: packages/api/db/migration/20201130123842_change_user_id_to_uuid.js:L3

The migration sets users.user_id default to uuid_generate_v1(), which is time/MAC-based and more predictable than random UUIDs. If user IDs are exposed through APIs, this can increase enumeration risk and leak metadata about creation time/host characteristics.

Solution

Use uuid_generate_v4() (or gen_random_uuid() in modern Postgres) for security-sensitive/public identifiers. Consider migrating existing externally exposed IDs to random UUIDs if feasible.

Changes

  • packages/api/db/migration/20201130123842_change_user_id_to_uuid.js (modified)
  • packages/api/db/migration/20200713160251_make_email_token_table.js (modified)

tomaioo added 2 commits April 22, 2026 11:14
- Security: Predictable UUID version used for user identifiers
- Security: Invitation/token values stored in plaintext

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: Predictable UUID version used for user identifiers
- Security: Invitation/token values stored in plaintext

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@tomaioo tomaioo requested review from a team as code owners April 22, 2026 18:14
@tomaioo tomaioo requested review from kathyavini and removed request for a team April 22, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant